package Day34.TreeSet;

import java.util.TreeSet;

public class TreeSetDemo {
    public static void main(String[] args) {
        TreeSet<String> treeSet = new TreeSet<>();
        treeSet.add("xxx");
        treeSet.add("aaa");
        treeSet.add("ccc");
        treeSet.add("yyy");
        System.out.println(treeSet);

        TreeSet<Integer> treeSet1 = new TreeSet<>();
        treeSet1.add(80);
        treeSet1.add(12);
        treeSet1.add(40);
        treeSet1.add(77);
        treeSet1.add(80);
        System.out.println(treeSet1);


        TreeSet<User> users = new TreeSet<>();
        User user1 = new User(1,"admin","123456");
        User user2 = new User(2,"admin1","123456");
        User user3 = new User(3,"admin2","123456");
        User user4 = new User(4,"admin3","123456");
        users.add(user1);
        users.add(user2);
        users.add(user3);
        users.add(user4);

        for(User user : users){
            System.out.println(user);
        }
    }
}
